/**
 *  \file I3TimerEvent.cpp
 *  \brief Similar to TimerEvent.  Except that in this case,
 *  we can have callbacks which take I3 specific arguments.
 */

#include "OCD_include.h"

#include "I3TimerEvent.h"

#include "i3_debug.h" // i3/debug.h
#include "i3CommonHeaders.h"

I3TimerEvent* I3TimerEvent::create (time_t seconds, suseconds_t microSeconds, I3Functor* cbk, bool cbkFreeFlag)  {
    return new I3TimerEvent (seconds, microSeconds, cbk, cbkFreeFlag);
}

I3TimerEvent::I3TimerEvent(time_t seconds, suseconds_t microSeconds, I3Functor* cbk, bool cbkFreeFlag) 

            :TimerEvent(seconds, microSeconds,cbk, cbkFreeFlag) {
}


I3TimerEvent* I3TimerEvent::create(time_t seconds, suseconds_t microSeconds, I3Functor* cbk, char *desc, bool cbkFreeFlag) {
    return new I3TimerEvent (seconds, microSeconds, cbk, cbkFreeFlag, desc);
}

I3TimerEvent::I3TimerEvent(time_t seconds, suseconds_t microSeconds, I3Functor* cbk, bool cbkFreeFlag, char *desc) 
            :TimerEvent(seconds, microSeconds,cbk,cbkFreeFlag, desc) {
}

void I3TimerEvent::destroy (I3TimerEvent* evt) {
    TimerEvent::destroy (evt);
}

/** Destructor */
I3TimerEvent::~I3TimerEvent() {
}

/**
  * This function is called when the timer event occurs.
  */
void I3TimerEvent::execute() {

    if (!disabledFlag) {
        (*cbk)();
    }
}
